package com.sleet.yuemiao.pojo;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.io.*;

/**
 * @program: yuemiao
 * @ClassName CustInfo
 * @description:
 * @author: Liyongxing
 * @create: 2021-12-24 18:47
 **/
@Data
@Configuration
@ConfigurationProperties(prefix = "cust")
public class CustInfo implements Serializable,Cloneable{
    String birthday;
    String tel;
    String sex;
    String cname;
    String idcard;
    String mxid;
    String date;
    String pid;
    String Ftime = "1";
    String guid="";
    String cookie ;

    public Object deepClone() throws Exception{
        // 序列化
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);

        oos.writeObject(this);

        // 反序列化
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bis);

        return ois.readObject();
    }
}
